/////////////// FIKA

function Fika(stack, symbolTable, outputFun) {

  var parser = new Parser();
  var interpreter = new Interpreter(stack, symbolTable, outputFun);

  this.exec = function(input) {
    try {
      this.execNoErrorHandling(input);
    }
    catch (e) {
      if (e instanceof LexingException) {
        outputFun("Lexing error: " + e.toString());
      }
      else if (e instanceof ParsingException) {
        outputFun("Parsing error: " + e.toString());
      }
      else if (e instanceof RuntimeException) {
        outputFun("Runtime error: " + e.toString());
      }
      else {
        outputFun("Error: " + e.toString() + "," + e.description + "," + e.number);
      }
    }
  };

  this.execNoErrorHandling = function(input) {
    var lexer = new Lexer(input);
    var parsedCode = parser.parse(lexer);
    interpreter.run(parsedCode);
  };

  this.getAuthorInfo = function () {
    return "Kevin P. Albrecht";
  };

  this.getVersionInfo = function () {
    return "Fika/JS; Version 0.1; Build 20081214.1930";
  };

}